package com.slw.caiji.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.slw.caiji.Vo.SysTemplateVo;
import com.slw.caiji.dto.SysTemplate;
import com.slw.caiji.dto.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SysTemplateMapper extends BaseMapper<SysTemplate> {
    @Select("<script>" +
            "select * from sys_template " +
            "<where>" +
            "<if test='sysTemplateVo.input!=null'>input=#{sysTemplateVo.input}</if>" +
            "<if test='sysTemplateVo.numberInput!=null'><if>number_input=#{sysTemplateVo.NumberInput}</if></if>" +
            "<if test='sysTemplateVo.dictSelect!=null'>AND dict_select=#{sysTemplateVo.dictSelect}</if>" +
            "<if test='sysTemplateVo.trendsSelect!=null'>AND trends_select=#{sysTemplateVo.trendsSelect}</if>" +
            "</where>" +
            "</script>")
    IPage<SysTemplate> listSysTemplate(Page<SysTemplate> page, @Param("sysTemplateVo") SysTemplate sysTemplateVo);

    @Select("<script>" +
            "select * from sys_template " +
            "<where>" +
            "<if test='sysTemplateVo.input!=null'>input=#{sysTemplateVo.input}</if>" +
            "<if test='sysTemplateVo.numberInput!=null'><if>number_input=#{sysTemplateVo.NumberInput}</if></if>" +
            "<if test='sysTemplateVo.dictSelect!=null'>AND dict_select=#{sysTemplateVo.dictSelect}</if>" +
            "<if test='sysTemplateVo.trendsSelect!=null'>AND trends_select=#{sysTemplateVo.trendsSelect}</if>" +
            "</where>" +
            "</script>")
    List<SysTemplate> getListSysTemplate(@Param("sysTemplateVo") SysTemplate sysTemplateVo);
}
